from langdev_helper.util.url import *
from langdev_helper.prompt.summary import *
from langdev_helper.prompt.rag import *
from langdev_core.llms.qianfan import call_llm
from langchain_core.prompts import PromptTemplate

test_url = "https://element-plus.org/zh-CN/guide/installation.html"
docs = load_url(test_url)

print(docs)
# print(prompt_summary)

prompt_template = PromptTemplate.from_template(rag_prompt)

q = "使用CDN的方式编写一个Hello World页面,页面中添加一个按钮,给出代码即可"
pt = prompt_template.format(context=docs, question=q)

res = call_llm(pt)
print(res)
